package com.powerwyx.shortlink.admin.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.powerwyx.shortlink.admin.pojo.dto.UserLoginDTO;
import com.powerwyx.shortlink.admin.pojo.dto.UserRegisterDTO;
import com.powerwyx.shortlink.admin.pojo.dto.UserUpdateDTO;
import com.powerwyx.shortlink.admin.pojo.entity.User;
import com.powerwyx.shortlink.admin.pojo.vo.UserLoginVO;
import com.powerwyx.shortlink.admin.pojo.vo.UserVO;

/**
* @author 17585
* @description 针对表【t_user】的数据库操作Service
* @createDate 2024-06-28 17:15:16
*/
public interface UserService extends IService<User> {

    /**
     * 根据用户名查询用户信息
     */
    UserVO getUserByUserName(String username);

    /**
     * 查询用户名是否存在
     */
    Boolean hasUserName(String username);

    /**
     * 注册用户
     * @param userRegisterDTO
     */
    void register(UserRegisterDTO userRegisterDTO);

    /**
     * 修改用户信息
     * @param userUpdateDTO
     */
    void updateUserInfo(UserUpdateDTO userUpdateDTO);

    /**
     * 用户登录
     * @param userLoginDTO
     * @return
     */
    UserLoginVO login(UserLoginDTO userLoginDTO);

    /**
     * 用户退出
     * @param username
     * @param token
     */
    void logout(String username, String token);

    /**
     * 检查用户是否登录
     * @param username
     * @param token
     * @return
     */
    Boolean checkUserLogin(String username, String token);


}
